package com.minelx.datamicroscope.querylanguage.data.content;

import com.alibaba.fastjson.JSONObject;

import java.util.List;

import static java.util.Collections.singletonList;

class SingleContent implements Content {

	private final String contentAsText;

	SingleContent(String contentAsText) {
		this.contentAsText = contentAsText;
	}

	@Override
	public List<JSONObject> toJSON() {
		JSONObject result = new JSONObject();
		result.put("content", contentAsText);
		return singletonList(result);
	}
}
